<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * date: 2021-09-07 20:25:16
 * @LastEditors: Sam
 * @LastEditTime: 2022-01-20 18:51:57
-->
{include file="common/public/header"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card">
            <div class="layui-tab">
                <ul class="layui-tab-title">
                    {foreach name="group_list" item="v" key="k"}
                    <li {if condition="$k==$inc_type" }class="layui-this" {
                    /if}>
                    <a href="{:url('setting/index',['inc_type'=> $k])}"><span>{$v}</span></a>
                    </li>
                    {/foreach}
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <form class="layui-form padsome" onSubmit="return false">

                            <input type="hidden" name="inc_type" value="{$inc_type}">
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">网站名称</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="title" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.title:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">网站关键字</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="keywords" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.keywords:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">网站描述</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="description" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.description:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" >
                                <div class="layui-form-label">Logo</div>
                                <div class="layui-input-block">
                                    <input type="hidden" name="logo" id="logo" value="{$config?$config.logo:''}" />
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">版权</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="copyright" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.copyright:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">公司简介</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="company_profile" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.company_profile:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" >
                                <div class="layui-form-label">公司图片</div>
                                <div class="layui-input-block">
                                    <input type="hidden" name="company_profile_img" id="company_profile_img" value="{$config?$config.company_profile_img:''}" />
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">业务介绍</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="business_introduction" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.business_introduction:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" >
                                <div class="layui-form-label">业务图片</div>
                                <div class="layui-input-block">
                                    <input type="hidden" name="business_introduction_img" id="business_introduction_img" value="{$config?$config.business_introduction_img:''}" />
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">手机</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="mobile" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.mobile:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">邮箱</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="email" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.email:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">地址</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="address" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.address:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">地址经度</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="longitude" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.longitude:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item" style="width: 60%;">
                                <div class="layui-form-label">地址纬度</div>
                                <div class="layui-input-block">
                                    <input class="layui-input" name="latitude" lay-verify="required"
                                           placeholder="请输入名称" value="{$config?$config.latitude:''}"/>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <div class="layui-footer" style="left: 0;">
                                        <button class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="">立即提交
                                        </button>
                                    </div>
                                </div>

                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="common/public/ueditor" /}
{include file="common/public/umeditor" /}
{include file="common/public/footer" /}
<script>
    layui.extend({
        xmSelect: 'xm-select'
    }).use(['index', 'form', 'layarea', 'laydate', 'xmSelect'], function () {
        var $ = layui.$;
        var form = layui.form;
        // var xmSelect = layui.xmSelect;
        uploadInit('logo', 'image', '');
        uploadInit('company_profile_img', 'image', '');
        uploadInit('business_introduction_img', 'image', '');
        form.render();
        // 监听表单提交
        form.on('submit()', function (data) {
            Post("{:url('set_handle')}", data.field, function (res) {
                if (res.code == 1) {
                    alert_success(res.msg, function () {
                        parent.layui.table.reload('table', {where: parent.where});
                        close_frame();
                    })
                } else {
                    alert_error(res.msg);
                }
            });
            return false;
        });

    });
</script>
